
{extend name='public/alert' /}

{block name="content"}

<div class="layui-fluid">
    <div class="layui-card">

        <div class="layui-card-body" style="padding: 15px;">

            <form class="layui-form " lay-filter="form">

                <div class="layui-form-item">
                    <label class="layui-form-label">标签名称：</label>
                    <div class="layui-input-inline">
                        <input type="text" name="name" lay-verify="required" placeholder="标签名称" lay-vertype="tips" lay-reqtext="请输入标签名称" class="layui-input">
                    </div>
                    <div class="layui-form-mid layui-word-aux">
                        在4到25个字符之间。
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">状态：</label>
                    <div class="layui-input-block">
                        <input type="radio" name="status" lay-filter="status" checked value="1" title="启用">
                        <input type="radio" name="status" lay-filter="status" value="0" title="关闭">
                    </div>
                </div>

                {if isset($info['id'])}
                <input type="hidden" name="id" value="{$info.id}" >
                {/if}

                <input type="hidden" name="wx_aid"  >

                {:widget('common/forms/submit',array('add','立即提交',2))}

            </form>

        </div>
    </div>
</div>



<script>
    layui.use(['element', 'form', 'jquery','lucky'], function () {
        var element = layui.element;
        var table = layui.table;
        var form = layui.form;
        var $ = layui.jquery;
        var lucky=layui.lucky;
        var info = {:json_encode($info)};
        form.val("form", info);
        form.render();

        form.on('submit(add)', function (data) {
            lucky.FormSubmit("{:url('tagAdd')}",data.field,"table_id",1);
            return false;
        });
    })
</script>

{/block}